﻿using System;

using System.Collections.Generic;
using System.Text;
using Silvermoon.Controls;
using Silvermoon.Shapes;
using Silvermoon.UI;
using Silvermoon.Controls.Base;
using Silvermoon.Animations;
using Silvermoon.Controls.Forms;

namespace Silvermoon.Windows.Styles
{
    public class MetroDialogStyle : StyleBase
    {
        //private static readonly VisualStateManager TransitionManager = new VisualStateManager(
        //     new VisualState(VState.Shown, new FloatTransition(FormBase.RotateHorizonProperty, 200, -90F, 0F, CircleEase.In), new IntTransition(FormBase.OpacityProperty, 50, 0, 255, ExponentialEase.Out)),
        //    new VisualState(VState.Hidden, new FloatTransition(FormBase.RotateHorizonProperty, 200, null, 90F, CircleEase.Out), new IntTransition(FormBase.OpacityProperty, 50, null, 0, ExponentialEase.Out) { Delay = 150 })
        //    //new VisualState(VState.Hidden, new FloatTransition(FormBase.TranslateYFactorProperty, 300, null, -1f), new IntTransition(FormBase.OpacityProperty, 300, null, 0))
        //    );

        public override void Apply(Control c)
        {
            Dialog d = (Dialog)c;

            if (d.Background == null) d.Background = PhoneColors.Dark;
            if (d.Chrome == null) d.Chrome = Shape.Empty;
            if (d.Color.IsEmpty) d.Color = PhoneColors.Dark;
            d.TransitionManager = TransitionManagers.DialogTransitionManager;

            StyleDictionary styles = new MetroStyles();
            d.Styles = StyleDictionary.Merge(d.Styles, styles);
        }
    }
}
